/*
**********************************************************************************
    OpenSURF642 : An TI DM642 implementation of OpenSURF.
    Copyright (C) 2011  Hai Yu

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
	This implementation is based on The original OpenSURF library created
	by Christopher Evans.The original work can be found at
		http://www.chrisevansdev.com/computer-vision-opensurf.html
	
    contact: yuhaihai12345@gmail.com	
**********************************************************************************
*/

#ifndef _IPOINT_
#define _IPOINT_
#ifndef _TI_ENHANCED_MATH_H
#define _TI_ENHANCED_MATH_H
#endif
#include "math.h"
/***********    Definition of structures  ***************************/
typedef struct
{	  
	  float x, y; //! Coordinates of the detected interest point
	  
	  float scale;	//! Detected scale

	  short orientation; //! Orientation measured anti-clockwise from +ve x-axis
	  
	  int laplacian; //! Sign of laplacian for fast matching purposes

	  short descriptor[64];//! Vector of descriptor components
}IPoint;
/***********    Declaration of Interfaces  ***************************/
inline float Distance(IPoint * self, IPoint * rhs)
{
    float sum=0.f;
	int i;
    for(i=0; i < 64; ++i)
      sum += (self->descriptor[i] - rhs->descriptor[i])*(self->descriptor[i] - rhs->descriptor[i]);
    return sqrtf(sum);
}
/***********    Declaration of Internal Functions  *******************/



#endif


